package com.puruo.mindhall.utils;

/**
 * <pre>
 * <b>PageUtil 分页工具类</b>
 * <b>Description: </b>
 * <b>@author:wangyong</b>
 * <b>Date:</b> 2021/9/16 17:32
 * <b>Copyright:</b> Copyright 2017-2019 wangyong Technology Co., Ltd. All rights reserved.
 * <b>Changelog:</b>
 *   Ver          Date                    Author                  Detail
 *   ----------------------------------------------------------------------
 *   1.0   2021/9/16 17:32    wangyong     new file.
 * </pre>
 */
public class PageUtil {

    /**
     * @param getPage
     * @param getLimit
     * @return int
     * @Description: 获取分页
     * @author wy
     * @date 2021/9/16
     */
    public static int getCurrentPage(Integer getPage, Integer getLimit) {
        int page = 1;
        int limit = 10;
        if (getPage != null) {
            page = getPage;
        }
        if (getLimit != null) {
            limit = getLimit;
        }
        return (page - 1) * limit;
    }

    public static int getCurrentLimit(Integer getLimit) {
        int limit = 10;

        if (getLimit != null) {
            limit = getLimit;
        }
        return limit;
    }

}
